from Page.page1 import Page1
from selenium.webdriver.common.by import By

#添加到购物车
class Page4(Page1):
    # 点击首页
    shouye_loc = (By.XPATH,'/html/body/div[3]/div[2]/ul/li[1]/a')
    def shouye(self):
        self.click(self.shouye_loc)

    # 输入框
    shuruk_loc = (By.CLASS_NAME,'search-input')
    def shuruk(self):
        self.send_keys(self.shuruk_loc,'电扇')

    # 搜索按钮
    sousuobtn_loc = (By.CLASS_NAME,'search-input-btn')
    def sousuobtn(self):
        self.click(self.sousuobtn_loc)

    # 点击商品
    shangpin_loc = (By.XPATH,'/html/body/div[5]/div[2]/div[2]/div[1]/ul/li[2]/div[1]/span/a/img')
    def shangpin(self):
        self.click(self.shangpin_loc)

    # 点击加入购物车
    gouwuche_loc  =  (By.ID,'add-cart')
    def gouwuche(self):
        self.click(self.gouwuche_loc)










